/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DAO;

import Connect.ConnectionJDBC;
import DatabasePOJO.cuahang;
import java.sql.ResultSet;

/**
 *
 * @author Mr-Nguyen
 */
public class cuahangDAO {
    public static cuahang getCuaHang(String ma)
    {
        cuahang ch = new cuahang();
        String sql = "select * from cuahang where MaCuaHang =" + ma;
        ConnectionJDBC cnn = new ConnectionJDBC();
        cnn.Connect();
        ResultSet rs = cnn.getTable(sql);
        try
        {
            rs.next();
            ch.setDiaChi(rs.getString("DiaChi"));
            ch.setTenCuaHang(rs.getString("TenCuaHang"));
            ch.setWebsite(rs.getString("Website"));
        }
        catch(Exception ex)
        {}
        finally
        {
            cnn.Close();
            return ch;
        }
        
    }
}
